PROJECT(XPMDOC-Schema)


FIND_PACKAGE(Qt4 REQUIRED)
#find xerces package
INCLUDE(${QT_USE_FILE})

#add the files to our groups and app
SOURCE_GROUP("textedit" ./textedit/*)
#seems to be a bug in cmake, can't put these in analysis\\standard folder :(
#upper detail

#QT4_WRAP_CPP
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

#xpmschema
QT4_WRAP_CPP(xpmschema_MOCS ./textedit/xpmschema.h)

#QT4_WARP_UI

SET(XPMDOC-Schema_Files
	#for example 
	#./control/ControlSynset.cpp	
	./textedit/main.cc	
	./textedit/xpmschema.cc
	${xpmschema_MOCS}	
)


#find our headers
file(GLOB_RECURSE HEADERS ${XPMDOC-Schema_SOURCE_DIR}/*.h)



#create the libraries
INCLUDE_DIRECTORIES( ${XPMDOC_SOURCE_DIR}/src/xpms
                     ${XPMDOC_SOURCE_DIR}/src/gui 
                     ${XPMDOC_SOURCE_DIR}/src/model
					 ${XPMDOC_SOURCE_DIR}/src/control
					 ${XPMDOC_SOURCE_DIR}/src/dal
					 )			 


add_executable(XPMDOC-Schema
	           ${XPMDOC-Schema_Files} 
	           ${HEADERS})

FIND_PACKAGE(XERCESC REQUIRED)

TARGET_LINK_LIBRARIES(XPMDOC-Schema
                      XPMDOC-Gui 
                      XPMDOC-Model 
                      XPMDOC-Control	
                      XPMDOC-Dal					  
					  ${QT_LIBRARIES}
					  ${XERCESC_LIBRARY})
					  
TARGET_LINK_LIBRARIES(XPMDOC-Schema
               optimized
			   D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Model.lib
               D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Control.lib
			   D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Dal.lib
			   D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Util.lib
			   D:/Projects/libs/libjson-master/bin/release/libjson.lib
			   D:/Projects/libsfa/build/bin/Release/libsfa.lib)
			   
TARGET_LINK_LIBRARIES(XPMDOC-Schema
               debug
               D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Modeld.lib
               D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Controld.lib
			   D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Dald.lib
			   D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Utild.lib
			   D:/Projects/libs/libjson-master/bin/release/libjson.lib
			   D:/Projects/libsfa/build/bin/Release/libsfa.lib)

#set properties on the libraries
SET_TARGET_PROPERTIES(XPMDOC-Schema PROPERTIES
    VERSION ${XPMDOC_VERSION}
    SOVERSION ${XPMDOC_SOVERSION}
    COMPILE_DEFINITIONS_DEBUG _DEBUG
)


if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    if(DEFINED MINGW)
		SET(CMAKE_EXE_LINKER_FLAGS "-mwindows -fopenmp")
	else(DEFINED MINGW)
#	    SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES COMPILE_FLAGS "${XPMDOC_SOURCE_DIR}/src/dal/dal/db/otlv4.h" )
#        SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES LINK_FLAGS "odbc32.lib" )
#		SET(CMAKE_CXX_FLAGS "/DGLUT_BUILDING_LIB /openmp")
#		SET(CMAKE_EXE_LINKER_FLAGS "/subsystem:windows /entry:mainCRTStartup")
	endif(DEFINED MINGW)
else(CMAKE_SYSTEM_NAME MATCHES "Windows")
	SET(CMAKE_EXE_LINKER_FLAGS "-fopenmp")
endif(CMAKE_SYSTEM_NAME MATCHES "Windows")



